﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.CalculateControls;
using 纸片人.win2dEffectControl.DataClass;
using 纸片人.win2dEffectControl.DataClass.PixelShaderEffectDataClass;

// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public sealed class WaveEffectControl : EffectControl
    {
        public WaveEffectControl()
        {
            this.DefaultStyleKey = typeof(WaveEffectControl);
            OneEffetData = new WaveEffectData();
        }

        public override EffectOneSourceData OneEffetData { get; set; }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            SetEffectName("扭曲效果：", "DistortionEffect");
            var wavelengthXTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("wavelengthXTextBoxSlider");
            SetTextBoxSlider(wavelengthXTextBoxSlider, OneEffetData, nameof(WaveEffectData.WavelengthX));

            var wavelengthYTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("wavelengthYTextBoxSlider");
            SetTextBoxSlider(wavelengthYTextBoxSlider, OneEffetData, nameof(WaveEffectData.WavelengthY));


            var amplitudeXTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("amplitudeXTextBoxSlider");
            SetTextBoxSlider(amplitudeXTextBoxSlider, OneEffetData, nameof(WaveEffectData.AmplitudeX));

            var amplitudeYTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("amplitudeYTextBoxSlider");
            SetTextBoxSlider(amplitudeYTextBoxSlider, OneEffetData, nameof(WaveEffectData.AmplitudeY));


        }


    }
}